﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FineSoft.Models
{
	public class Config
	{
		public int OwnerIndex;
		private Class _Owner;
		public Class Owner
		{
			get
			{
				if (this._Owner == null)
					this._Owner = InitialData.Classes[this.OwnerIndex];
				return this._Owner;
			}
		}

		public int[] TypeIndexes;
		private Class[] _Types;
		public Class[] Types
		{
			get
			{
				if (this._Types == null)
					this._Types = this.TypeIndexes.Select(i => InitialData.Classes[i]).ToArray();
				return this._Types;
			}
		}

		public string Name { get; set; }
		public string Description { get; set; }
		public bool Required;

		//public static readonly string[] RequiredConfigs = { "columns", "store", "menu" };

		public Object DefaultValue;
	}
}